package com.ehotting.mqbd.api.bean.solver;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.Objects;

public class SolverInfoBean implements java.io.Serializable{

    private String ip;
    private String port;
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String name;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        SolverInfoBean serverInfo = (SolverInfoBean) obj;
        return Objects.equals(ip, serverInfo.ip) && Objects.equals(port, serverInfo.port) ;
    }

    public String toStringIpAndPort(){
        return ip+":"+port;
    }

    @Override
    public String toString() {
        return "SolverInfoBean{" +
                "ip='" + ip + '\'' +
                ", port='" + port + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
